<template>
<div>
  添加学生
  <input type="text" v-model="form.name">
  <input type="text" v-model="form.age">
  <button @click="add">添加</button>
  <ul>
    <li v-for="i in stulist">{{i.name}}</li>
  </ul>
</div>
</template>

<script>
export default {
  name: "stus",
  data(){
    return{
      form:{'teacher':localStorage.getItem('tid')},
      stulist
    }
  },
  mounted() {
    let tid=localStorage.getItem('tid')
    if(!tid){
      alert('请登录后操作')
      this.$router.push({"path":'/tlogin'})
    }
  }
}
</script>

<style scoped>

</style>
